\(\int \frac {1}{\sqrt {-2 x+x^2}} \, dx\) [29]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 11, antiderivative size = 16 \[ \int \frac {1}{\sqrt {-2 x+x^2}} \, dx=2 \text {arctanh}\left (\frac {x}{\sqrt {-2 x+x^2}}\right ) \]

[Out]

2*arctanh(x/(x^2-2*x)^(1/2))

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {634, 212} \[ \int \frac {1}{\sqrt {-2 x+x^2}} \, dx=2 \text {arctanh}\left (\frac {x}{\sqrt {x^2-2 x}}\right ) \]

[In]

Int[1/Sqrt[-2*x + x^2],x]

[Out]

2*ArcTanh[x/Sqrt[-2*x + x^2]]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 634

Int[1/Sqrt[(b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(1 - c*x^2), x], x, x/Sqrt[b*x + c*x^2
]], x] /; FreeQ[{b, c}, x]

Rubi steps \begin{align*} \text {integral}& = 2 \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\frac {x}{\sqrt {-2 x+x^2}}\right ) \\ & = 2 \tanh ^{-1}\left (\frac {x}{\sqrt {-2 x+x^2}}\right ) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(39\) vs. \(2(16)=32\).

Time = 0.05 (sec) , antiderivative size = 39, normalized size of antiderivative = 2.44 \[ \int \frac {1}{\sqrt {-2 x+x^2}} \, dx=-\frac {2 \sqrt {-2+x} \sqrt {x} \log \left (\sqrt {-2+x}-\sqrt {x}\right )}{\sqrt {(-2+x) x}} \]

[In]

Integrate[1/Sqrt[-2*x + x^2],x]

[Out]

(-2*Sqrt[-2 + x]*Sqrt[x]*Log[Sqrt[-2 + x] - Sqrt[x]])/Sqrt[(-2 + x)*x]

Maple [A] (verified)

Time = 1.93 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.88

method result size
default \(\ln \left (-1+x +\sqrt {x^{2}-2 x}\right )\) \(14\)
trager \(\ln \left (-1+x +\sqrt {x^{2}-2 x}\right )\) \(14\)
pseudoelliptic \(2 \,\operatorname {arctanh}\left (\frac {\sqrt {x \left (-2+x \right )}}{x}\right )\) \(15\)
meijerg \(\frac {2 \sqrt {-\operatorname {signum}\left (-2+x \right )}\, \arcsin \left (\frac {\sqrt {2}\, \sqrt {x}}{2}\right )}{\sqrt {\operatorname {signum}\left (-2+x \right )}}\) \(26\)

[In]

int(1/(x^2-2*x)^(1/2),x,method=_RETURNVERBOSE)

[Out]

ln(-1+x+(x^2-2*x)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.06 \[ \int \frac {1}{\sqrt {-2 x+x^2}} \, dx=-\log \left (-x + \sqrt {x^{2} - 2 \, x} + 1\right ) \]

[In]

integrate(1/(x^2-2*x)^(1/2),x, algorithm="fricas")

[Out]

-log(-x + sqrt(x^2 - 2*x) + 1)

Sympy [A] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.06 \[ \int \frac {1}{\sqrt {-2 x+x^2}} \, dx=\log {\left (2 x + 2 \sqrt {x^{2} - 2 x} - 2 \right )} \]

[In]

integrate(1/(x**2-2*x)**(1/2),x)

[Out]

log(2*x + 2*sqrt(x**2 - 2*x) - 2)

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.06 \[ \int \frac {1}{\sqrt {-2 x+x^2}} \, dx=\log \left (2 \, x + 2 \, \sqrt {x^{2} - 2 \, x} - 2\right ) \]

[In]

integrate(1/(x^2-2*x)^(1/2),x, algorithm="maxima")

[Out]

log(2*x + 2*sqrt(x^2 - 2*x) - 2)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 33 vs. \(2 (14) = 28\).

Time = 0.28 (sec) , antiderivative size = 33, normalized size of antiderivative = 2.06 \[ \int \frac {1}{\sqrt {-2 x+x^2}} \, dx=\frac {1}{2} \, \sqrt {x^{2} - 2 \, x} {\left (x - 1\right )} + \frac {1}{2} \, \log \left ({\left | -x + \sqrt {x^{2} - 2 \, x} + 1 \right |}\right ) \]

[In]

integrate(1/(x^2-2*x)^(1/2),x, algorithm="giac")

[Out]

1/2*sqrt(x^2 - 2*x)*(x - 1) + 1/2*log(abs(-x + sqrt(x^2 - 2*x) + 1))

Mupad [B] (verification not implemented)

Time = 9.63 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.69 \[ \int \frac {1}{\sqrt {-2 x+x^2}} \, dx=\ln \left (x+\sqrt {x\,\left (x-2\right )}-1\right ) \]

[In]

int(1/(x^2 - 2*x)^(1/2),x)

[Out]

log(x + (x*(x - 2))^(1/2) - 1)